package com.xiaoq.order.entity;

import com.xiaoq.MongoEntity;
import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xinpeng created on 16/9/21-下午4:09.
 *用户一次只能针对一个小店的商品下订单
 */
@Entity(value = "shop_orders_collection", noClassnameStored = true)
public class ShopOrderEntity extends MongoEntity {

    private String userId; //下单人id

    private String cellphoneNumber; //下单人电话

    private String userRealName; //下单人真实姓名

    //private DeliveryAddressDTO deliveryAddress; //交付地址,快递地址,如果一个批次订单包含多个小店的产品,每个小店订单都冗余存储此地址

    private String shopId; //小店ID

    private String shopName; //小店名称

    private String shopLogoUrl; //小店logo的url地址

    private String shopOrderId; //小店订单ID;

    private String interpreterId; //讲解员Id

    private Long createTime; //订单创建时间;

    @Embedded
    private List<ShoppingItem> shoppingItems = new ArrayList<>(); //本次在当前小店中购买的商品条目集合

    private Integer distributionType; //配送方式

    private Float expressFee; //运费

    private String couponCode; //本次订单中使用的优惠券编码,对应于CouponEntity中的id
    private String userCounponId; //下单用户使用的userCoupon  id

    private Integer numberOfAvailableCoupons; //可用优惠券的数量

    private Integer totalMoneyOfUsedCoupons; //优惠券总金额

    private double totalAmount; //当前小店订单的总金额

    private String supplement; //订单补充说明

    private Integer orderState; //小店订单状态  @see OrderState.java

    private Integer payState; //支付状态, @see PayState.java

    private Long paidTime; //订单支付成功时间

    private Long deliveriedTime; //订单发货时间

    private Long receivedTime;  //收货时间

    private Long reviewedTime; //订单评论时间

    private Long completedTime; //订单完成时间

    private Long canceledTime; //订单取消时间

    private Long closedTime; //订单关闭时间

    private Integer payType; //支付方式(1、微信，2、支付宝, 3、银联支付)

    private Long payEndTime; //支付结束时间（用于倒计时）

    private Double realPayMoney; //实际付款（微信支付宝 通知时设置此值）

    private String meetPlace; //见面的地方

    private String interDeleteFlag; // 讲解员删除标识 0: 未删除，1:删除
    private Long interDeleteTime; //讲解员删除时间

    private Long userDeleteTime; // 用户删除时间
    private String userDeleteFlag; // 0: 未删除，1:删除

    private Integer orderType; //订单类型 见（ConstantUtil）

    private String note; //备注

	/*** 用户来自哪里, 注册时,根据手机归属地查询用户来自哪里(市级)  */
	private String userFrom;

	/*** 分销商id */
	private String distributorId;


	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getCellphoneNumber() {
		return cellphoneNumber;
	}

	public void setCellphoneNumber(String cellphoneNumber) {
		this.cellphoneNumber = cellphoneNumber;
	}

	public String getUserRealName() {
		return userRealName;
	}

	public void setUserRealName(String userRealName) {
		this.userRealName = userRealName;
	}

	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public String getShopLogoUrl() {
		return shopLogoUrl;
	}

	public void setShopLogoUrl(String shopLogoUrl) {
		this.shopLogoUrl = shopLogoUrl;
	}

	public String getShopOrderId() {
		return shopOrderId;
	}

	public void setShopOrderId(String shopOrderId) {
		this.shopOrderId = shopOrderId;
	}

	public String getInterpreterId() {
		return interpreterId;
	}

	public void setInterpreterId(String interpreterId) {
		this.interpreterId = interpreterId;
	}

	public Long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}

	public List<ShoppingItem> getShoppingItems() {
		return shoppingItems;
	}

	public void setShoppingItems(List<ShoppingItem> shoppingItems) {
		this.shoppingItems = shoppingItems;
	}

	public Integer getDistributionType() {
		return distributionType;
	}

	public void setDistributionType(Integer distributionType) {
		this.distributionType = distributionType;
	}

	public Float getExpressFee() {
		return expressFee;
	}

	public void setExpressFee(Float expressFee) {
		this.expressFee = expressFee;
	}

	public String getCouponCode() {
		return couponCode;
	}

	public void setCouponCode(String couponCode) {
		this.couponCode = couponCode;
	}

	public String getUserCounponId() {
		return userCounponId;
	}

	public void setUserCounponId(String userCounponId) {
		this.userCounponId = userCounponId;
	}

	public Integer getNumberOfAvailableCoupons() {
		return numberOfAvailableCoupons;
	}

	public void setNumberOfAvailableCoupons(Integer numberOfAvailableCoupons) {
		this.numberOfAvailableCoupons = numberOfAvailableCoupons;
	}

	public Integer getTotalMoneyOfUsedCoupons() {
		return totalMoneyOfUsedCoupons;
	}

	public void setTotalMoneyOfUsedCoupons(Integer totalMoneyOfUsedCoupons) {
		this.totalMoneyOfUsedCoupons = totalMoneyOfUsedCoupons;
	}

	public double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(double totalAmount) {
		this.totalAmount = totalAmount;
	}

	public String getSupplement() {
		return supplement;
	}

	public void setSupplement(String supplement) {
		this.supplement = supplement;
	}

	public Integer getOrderState() {
		return orderState;
	}

	public void setOrderState(Integer orderState) {
		this.orderState = orderState;
	}

	public Integer getPayState() {
		return payState;
	}

	public void setPayState(Integer payState) {
		this.payState = payState;
	}

	public Long getPaidTime() {
		return paidTime;
	}

	public void setPaidTime(Long paidTime) {
		this.paidTime = paidTime;
	}

	public Long getDeliveriedTime() {
		return deliveriedTime;
	}

	public void setDeliveriedTime(Long deliveriedTime) {
		this.deliveriedTime = deliveriedTime;
	}

	public Long getReceivedTime() {
		return receivedTime;
	}

	public void setReceivedTime(Long receivedTime) {
		this.receivedTime = receivedTime;
	}

	public Long getReviewedTime() {
		return reviewedTime;
	}

	public void setReviewedTime(Long reviewedTime) {
		this.reviewedTime = reviewedTime;
	}

	public Long getCompletedTime() {
		return completedTime;
	}

	public void setCompletedTime(Long completedTime) {
		this.completedTime = completedTime;
	}

	public Long getCanceledTime() {
		return canceledTime;
	}

	public void setCanceledTime(Long canceledTime) {
		this.canceledTime = canceledTime;
	}

	public Long getClosedTime() {
		return closedTime;
	}

	public void setClosedTime(Long closedTime) {
		this.closedTime = closedTime;
	}

	public Integer getPayType() {
		return payType;
	}

	public void setPayType(Integer payType) {
		this.payType = payType;
	}

	public Long getPayEndTime() {
		return payEndTime;
	}

	public void setPayEndTime(Long payEndTime) {
		this.payEndTime = payEndTime;
	}

	public Double getRealPayMoney() {
		return realPayMoney;
	}

	public void setRealPayMoney(Double realPayMoney) {
		this.realPayMoney = realPayMoney;
	}

	public String getMeetPlace() {
		return meetPlace;
	}

	public void setMeetPlace(String meetPlace) {
		this.meetPlace = meetPlace;
	}

	public String getInterDeleteFlag() {
		return interDeleteFlag;
	}

	public void setInterDeleteFlag(String interDeleteFlag) {
		this.interDeleteFlag = interDeleteFlag;
	}

	public Long getInterDeleteTime() {
		return interDeleteTime;
	}

	public void setInterDeleteTime(Long interDeleteTime) {
		this.interDeleteTime = interDeleteTime;
	}

	public Long getUserDeleteTime() {
		return userDeleteTime;
	}

	public void setUserDeleteTime(Long userDeleteTime) {
		this.userDeleteTime = userDeleteTime;
	}

	public String getUserDeleteFlag() {
		return userDeleteFlag;
	}

	public void setUserDeleteFlag(String userDeleteFlag) {
		this.userDeleteFlag = userDeleteFlag;
	}

	public Integer getOrderType() {
		return orderType;
	}

	public void setOrderType(Integer orderType) {
		this.orderType = orderType;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getUserFrom() {
		return userFrom;
	}

	public void setUserFrom(String userFrom) {
		this.userFrom = userFrom;
	}

	public String getDistributorId() {
		return distributorId;
	}

	public void setDistributorId(String distributorId) {
		this.distributorId = distributorId;
	}
}